#ifndef LINKED_LIST_HEADER
#define LINKED_LIST_HEADER

#ifdef __cplusplus
extern "C"
{
#endif

/* TODO:
	LL_GetLastElement;
*/

#include <stdlib.h>

typedef struct LL_Element
{
	void *Data;
	struct LL_Element *Next;
}LL_Element;

/*
struct _LL_Element
{
	void *Data;
	_LL_Element *Next;
};

typedef _LL_Element LL_Element;
*/
/* This function will 'cut' elements off of the end of First, by
	placing Second after First

	Return:
		This function will return a pointer to First
*/
LL_Element *LL_AppendElement(LL_Element *First, LL_Element *Second);

/* This function will insert an element after First, and shift 
	everything after it along one
	
	Return:
		This function will return a pointer to First
*/
LL_Element *LL_InsertElement(LL_Element *First, LL_Element *Second);

/* This function will return the Nth element from the element From
	typically From is the first element in the list, but you know...
	Return:
		This function will return a pointer to first
*/
LL_Element *LL_GetNthElementFrom(LL_Element *From, int N);

/* This function will return the remaining size from the element From,
	typically From is the first element to get the total size of the list...
*/
int LL_GetSizeFrom(LL_Element *From);

/* This function removes all elements between One and Two
	For example:
	
	Index	[0][1][2][3]
	Value	[1][3][5][7]
	
	After removing all elements between 0 and 2:
	
	Index	[0][1][2]
	Value	[1][5][7]
	Return:
		This function will return a pointer to One
*/
LL_Element *LL_RemoveElementsBetween(LL_Element *One, LL_Element *Two);

/* This function appends ListTwo on the element ListOne */
LL_Element *LL_MergeLists(LL_Element *ListOne, LL_Element *ListTwo);

/*This function inserts List at element At
	Return:
		This functions returns a pointer to At
	
	NOTE: The last element in List must point to NULL
*/
LL_Element *LL_InsertListIntoList(LL_Element *At, LL_Element *List);

#ifdef __cplusplus
}
#endif

#endif
